<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>在线音音乐</title>
		<link rel="stylesheet" type="text/css" href="CSS/onlinemusic_class.css"/>
		<link rel="stylesheet" type="text/css" href="CSS/olinemusic_id.css"/>
		<script type="text/javascript" src="js/jQuery-1.8.3.js" ></script>
		<script type="text/javascript" src="js/jquery-1.11.1.js" ></script>
		<script type="text/javascript" src="js/action.js"></script>
		<link href="CSS/style.css" rel="stylesheet"/>
<script language="javascript"> 
//控制复选框的全选或反选操作
function CheckAll(elementsA,elementsB){
	for(i=0;i<elementsA.length;i++){
		elementsA[i].checked = true;
	}
	if(elementsB.checked ==false){
		for(j=0;j<elementsA.length;j++){
			elementsA[j].checked = false;
		}
	}
}
//判断用户是否选择了要播放的歌曲，如果没有选择，则提示“请选择要播放的歌曲”；否则提交表单进行播放
function continuePlay(playId,formname){
	var flag = false;
	for(i=0;i<playId.length;i++){
		if(playId[i].checked){
			flag = true;
			break;
		}
	}
	if(!flag){
		alert("请选择要播放的记录！");
		return false;
	}else{
		formname.submit();
	}
}
function checkpwd(){
  var p1 = document.getElementById("qq").value;  
    var p2 = document.getElementById("ww").value;  
  if(p1==""){
   alert("请输入密码！");//检测到密码为空，提醒输入//
   return false;//退出检测函数
  }//如果允许空密码，可取消这个条件
  
  if(p1!=p2){//判断两次输入的值是否一致，不一致则显示错误信息
   alert("两次输入密码不一致，请重新输入");//检测到密码为空，提醒输入//
   return false;
  }else{
   //密码一致，可以继续下一步操作 
  }
 }
</script> 
<script type="text/javascript" src="js/jquery-1.11.1.js" ></script>
<script type="text/javascript">
$(function(){



});
</script>
	</head>
	<body>
		<div  class="overAll">
			<div class="top" style="background-image: url('images/top.jpg');height: 120px;" >
				<c:choose>
				<c:when test="${sessionScope.login.manager==null}">
				
				<p class="top_p">
					<p class="regit">注册</p>
					<p class="login">登录  |</p>
				</p>
				</c:when>
				<c:otherwise>
				<a href="admin.do?name=${sessionScope.login.manager}" >欢迎${sessionScope.login.manager }管理员!点击进入后台 </a>
				</c:otherwise>
				</c:choose>
				<div style="position: absolute;right: 150px;top: 50px;">
				<form name="form_search" method="post" action="searchBy.do?action=search">
  搜索：<input type="text" name="key" id="key">
<input name="fieldName" type="radio" class="noborder" value="songName" checked>
  歌曲名
  &nbsp;
  <input name="fieldName" type="radio" class="noborder" value="specialName">
  专辑 &nbsp;
  <input name="fieldName" type="radio" class="noborder" value="singer">
  歌手&nbsp;
    <input name="songType_more" type="hidden" id="songType_more" value="0">
  <input name="Submit" type="submit" class="btn_bg" value="搜 索">
  </form>
  </div>
			</div>
			<div id="picture" style="background-image: url('images/bac.jpg');">
				<div id="picture_in">
					<a href=""><img src="images/轮播图.jpg" /></a>
				</div>	
			</div>
			<div class="main" style="background-image: url('images/zhuti.jpg');">
				<div id="main_top">
					<ul>
						<li id="l1">首页</li>
						<li id="l2">我的</li>
						<li id="l3">乐库</li>
					</ul>
				</div>
				<div id="mian_content1">
				<p style="float: left;"><strong>热门专辑</strong></p>
	<ul style="height:100px; list-style-type: none;">
	<c:forEach items="${stzj }" var="aa" >
	<li><a href="showBySpecial.do?special=${aa }&pageNo=${pageNo } " >${aa }</a></li>
	</c:forEach>
	</ul>
  	<hr size="1" align="center"> 
  <br> 
  <p style="float: left;" ><strong>爆红歌手</strong></p>
	<ul style="height:100px; list-style-type: none;">
	<c:forEach items="${singerlist }" var="bb" >
	<li><a href="SongerShow.do?singer=${bb }&pageNo=${pageNo } " >${bb }</a></li>
	</c:forEach>
	</ul>
  	<hr size="1" align="center"> 
  <br> 
  <p style="float: left;"><strong>新歌速递</strong></p>
	<ul style="height:100px; list-style-type: none;">
	<c:forEach items="${xgsd }" var="cc" >
	<li><a href="songShow.do?id=${cc.id }&pageNo=${pageNo } " >${cc.songName }</a></li>
	</c:forEach>
	</ul>
  	<hr size="1" align="center"> 
  <br> 
  </div>
				<div id="mian_content2">
					<c:choose>
				<c:when test="${user.id>0 }">
					<div id="load">
						<p>下载</p>
						<div>
						<form name="formhits1" method="post" action="continuePlay.do?action=continuePlay" target="_blank">
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr bgcolor="#E7EAE2"><td height="24">&nbsp;</td><td class="word_gray">&nbsp;歌曲名</td><td class="word_gray">演唱者</td></tr>
	
	<c:forEach items="${listenlist }" var="song" >
	
      <tr>
	    <td align="center">
	      <input type="checkbox" class="noborder" id="playId" name="playId" value="${song.id }">	    </td>
        <td height="27" title=" Hotline Bling" class="word_gray1">&nbsp;
        ${song.songName }</td>
        <td title="${song.singer }" class="word_gray1">&nbsp;
        ${song.singer }</td>
		</tr>
		</c:forEach>
 	
  </table>
  <table width="100%"  border="0" cellspacing="0" cellpadding="0"> 
  <tr> 
	
	<td height="24" align="right" style="padding-left:10px" class="word_gray1">
	<input name="checkbox" type="checkbox" class="noborder" onClick="CheckAll(this.form.playId,this.form.checkbox)"> 
	  [<span class="word_green">全选/反选</span>] [<a style="color:FA6E00;cursor:hand;" onClick="continuePlay(formhits1.playId,formhits1)">歌曲连播</a>] 
	  <div id="ch" style="display:none"> 
		<input name="playId" type="checkbox" class="noborder" value="0"> 
	  </div></td> 
	<!--层ch用于放置隐藏的checkbox控件，因为当表单中只是一个checkbox控件时，应用javascript获得其length属性值为undefine-->
	</tr> 
</table>
  </form>
						</div>
					</div>
					<div id="test">
						<p>试听</p>
						<div>
						<form name="formhits2" method="post" action="continuePlay.do?action=continuePlay" target="_blank">
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr bgcolor="#E7EAE2"><td height="24">&nbsp;</td><td class="word_gray">&nbsp;歌曲名</td><td class="word_gray">演唱者</td></tr>
	
	<c:forEach items="${downloadlist }" var="song" >
      <tr>
	    <td align="center">
	      <input type="checkbox" class="noborder" id="playId" name="playId" value="${song.id }">	    </td>
        <td height="27" title=" Hotline Bling" class="word_gray1">&nbsp;
        ${song.songName }</td>
        <td title="${song.singer }" class="word_gray1">&nbsp;
        ${song.singer }</td>
		</tr>
		</c:forEach>
 	
  </table>
  <table width="100%"  border="0" cellspacing="0" cellpadding="0"> 
  <tr> 
	
	<td height="24" align="right" style="padding-left:10px" class="word_gray1">
	<input name="checkbox" type="checkbox" class="noborder" onClick="CheckAll(this.form.playId,this.form.checkbox)"> 
	  [<span class="word_green">全选/反选</span>] [<a style="color:FA6E00;cursor:hand;" onClick="continuePlay(formhits2.playId,formhits2)">歌曲连播</a>] 
	  <div id="ch" style="display:none"> 
		<input name="playId" type="checkbox" class="noborder" value="0"> 
	  </div></td> 
	<!--层ch用于放置隐藏的checkbox控件，因为当表单中只是一个checkbox控件时，应用javascript获得其length属性值为undefine-->
	</tr> 
</table>
  </form>
						</div>
					</div>
					</c:when>
					<c:otherwise>
					<h1>您还没有登录！请先登录！</h1>
					</c:otherwise>
					</c:choose>
				</div>
				<div id="mian_content3">
					<ul><li>
				<c:forEach items="${topics }" var="topic" >
				<li><a href="showByType.do?id=${topic.id }">${topic.typeName }</a></li>
				</c:forEach>
					</ul>
				</div>
			</div>
			<div id="index_right" style="float:left;width:220px; margin-left:5px;">
  <table width="100%" height="56" border="0" cellpadding="0" cellspacing="0" style="padding-left:5px" class="tableBorder">
    <tr>
      <td width="4%" height="27" valign="middle" bgcolor="#CFED0A" class="word_darkGreen"><img src="images/title_ico.gif"></td>
      <td width="96%" valign="middle" bgcolor="#CFED0A" class="word_darkGreen">试听排行榜</td>
    </tr>
    <tr>
      <td colspan="2">



<table width="220" height="60" border="0" cellpadding="0" cellspacing="0" style="padding:4px;">
  <tr>
    <td>
    <form name="formhits" method="post" action="continuePlay.do?action=continuePlay" target="_blank">
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr bgcolor="#E7EAE2"><td height="24">&nbsp;</td><td class="word_gray">&nbsp;歌曲名</td><td class="word_gray">演唱者</td><td class="word_gray">次数</td></tr>
	
	<c:forEach items="${stph }" var="song" >
	
      <tr>
	    <td align="center">
	      <input type="checkbox" class="noborder" id="playId" name="playId" value="${song.id }">	    </td>
        <td height="27" title=" Hotline Bling" class="word_gray1">&nbsp;
        ${song.songName }</td>
        <td title="${song.singer }" class="word_gray1">&nbsp;
        ${song.singer }</td>
		<td class="word_gray1">${song.hits }</td>
		</tr>
		</c:forEach>
 	
  </table>
  <table width="100%"  border="0" cellspacing="0" cellpadding="0"> 
  <tr> 
	
	<td height="24" align="right" style="padding-left:10px" class="word_gray1">
	<input name="checkbox" type="checkbox" class="noborder" onClick="CheckAll(this.form.playId,this.form.checkbox)"> 
	  [<span class="word_green">全选/反选</span>] [<a style="color:FA6E00;cursor:hand;" onClick="continuePlay(formhits.playId,formhits)">歌曲连播</a>] 
	  <div id="ch" style="display:none"> 
		<input name="playId" type="checkbox" class="noborder" value="0"> 
	  </div></td> 
	<!--层ch用于放置隐藏的checkbox控件，因为当表单中只是一个checkbox控件时，应用javascript获得其length属性值为undefine-->
	</tr> 
</table>
  </form></td>
        </tr>
      </table>	  </td>
    </tr>
  </table>
  
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="5"></td>
    </tr>
  </table> 
  <table width="100%" height="56" border="0" cellpadding="0" cellspacing="0" style="padding-left:5px" class="tableBorder">
    <tr>
      <td width="4%" height="27" valign="middle" bgcolor="#CFED0A" class="word_darkGreen"><img src="images/title_ico.gif"></td>
      <td width="96%" valign="middle" bgcolor="#CFED0A" class="word_darkGreen">下载排行榜</td>
    </tr>
    <tr>
      <td colspan="2">



<table width="220" height="60" border="0" cellpadding="0" cellspacing="0" style="padding:4px;">
  <tr>
    <td><form name="formdownload" method="post" action="continuePlay.do?action=continuePlay" target="_blank">
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr bgcolor="#E7EAE2"><td height="24">&nbsp;</td><td class="word_gray">&nbsp;歌曲名</td><td class="word_gray">演唱者</td><td class="word_gray">次数</td></tr>
	<c:forEach items="${xzph }" var="song1">
      <tr>
	    <td align="center">
	      <input type="checkbox" class="noborder" id="playId" name="playId" value="${song1.id }">	    </td>
        <td height="27" title=" ${song1.songName }" class="word_gray1">&nbsp;
        ${song1.songName }</td>
        <td title="  ${song1.singer }" class="word_gray1">&nbsp;
        ${song1.singer }</td>
		<td class="word_gray1">${song1.download }</td>
		</tr>
		</c:forEach>
  </table>
  <table width="100%"  border="0" cellspacing="0" cellpadding="0"> 
  <tr> 
	
	<td height="24" align="right" style="padding-left:10px" class="word_gray1"><input name="checkbox" type="checkbox" class="noborder" onClick="CheckAll(this.form.playId,this.form.checkbox)"> 
	  [<span class="word_green">全选/反选</span>] [<a style="color:FA6E00;cursor:hand;" onClick="continuePlay(formdownload.playId,formdownload)">歌曲连播</a>] 
	  <div id="ch" style="display:none"> 
		<input name="playId" type="checkbox" class="noborder" value="0"> 
	  </div></td> 
	<!--层ch用于放置隐藏的checkbox控件，因为当表单中只是一个checkbox控件时，应用javascript获得其length属性值为undefine-->
	</tr> 
</table>
  </form></td>
        </tr>
      </table>	  </td>
    </tr>
  </table>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table>  
</div>
		</div>
		<div id="loin" style="background-color: gray;">
			<form  id="loin_form" action="login.do" method="post">
				<img id="loin_form_img" src="images/退出.jpg" />
				<div id="type">
					<input type="radio" name="identity" value="putong" />
					<span>普通用户</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="radio" name="identity"  value="admin" checked="checked" />
					<span>管理员</span>
				</div>
				<table>
					<tr>
						<td  id="t1">
							<span>用户账号</span>
							<input class="text1" type="text" name="name"/>	
						</td>
					</tr>
					<div id="erro1">账号不能为空</div>
					<tr id="t2">
						<td>
							<span>登录密码</span>
							<input class="text2" type="password" name="password"/>
						</td>
					</tr>
					<div id="erro2">密码不能为空</div>
				</table>
				<input id="esc" type="reset" value="取消"/>
				<input id="login" type="submit" value="登录"/>
			</form>
		</div>
		<div id="register" style="background-color: gray;">
			<form  id="loin_form" action="register.do 

" method="post">
				<img id="loin_form_img2" src="images/退出.jpg" />
				<div id="type">
					<span>用户注册</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<table>
					<tr>
						<td  id="t1">
							<span>用户账号</span>
							<input class="text1" type="text" name="name"/>	
						</td>
					</tr>
					<div id="erro1">账号不能为空</div>
					<tr id="t22">
						<td>
							<span>登录密码</span>
							<input id="qq" class="text2" type="password" name="password"/>
						</td>
					</tr>
					<tr id="t33">
						<td>
							<span>确认密码</span>
							<input id="ww" class="text2" type="password" name="password" onblur="checkpwd()" />
						</td>
					</tr>
					<div id="erro2">密码不能为空</div>
				</table>
				<input id="esc" type="reset" value="取消"/>
				<input id="login" type="submit" value="确认注册"/>
			</form>
		</div>
		
		<div id="copyright" style="width: 98%;" >
<ul>
	<li> 流行金曲 | 经典老歌 | 欧美经典 | 校园民谣 | 联系我们 | 编程词典网 | 明日图书网 | 明日科技主站 </li>
	<li>技术服务热线：400-675-1066 传真：0431-84972266 企业邮箱：mingrisoft@mingrisoft.com</li>
	<li>
	公司地址：吉林省长春市亚泰广场C座  欢迎致电来函</li>
	<li>Copyright &copy; www.mrbccd.com All Rights Reserved! </li>
</ul>
</div>
	</body>
</html>
